﻿using System;
using System.ComponentModel.Design;
using Microsoft.VisualStudio.Shell;
using PS_WSSDeploy_Package.Client;
using PS_WSSDeploy_Package.Settings;

namespace PS_WSSDeploy_Package.WdCommand
{
    class SettingsCmd : BaseCmd
    {
        public static BaseCmd Create(OleMenuCommandService service, bool enableForSandbox)
        {
            var instance = new SettingsCmd();
            var cmdId = new CommandID(GuidList.guidPS_WSSDeploy_PackageCmdSet, (int)PkgCmdIDList.cmdidSettingsCommand);
            AddCommandToMenu(service, instance, cmdId, enableForSandbox);
            return instance;
        }

        public override void DoExecute()
        {
            var settingForm = new SettingForm(IsSharePointSandboxProject, Cc, SolutionPath);
            settingForm.ShowDialog();
        }

        public override bool DoCheckExistConfig()
        {
            return true;
        }

        public override void DoPreExecute()
        {

        }

        public override void DoPostExecute()
        {

        }
    }
}
